package com.liangwj.springbootrabbitmq.rabbit.object;

import com.liangwj.springbootrabbitmq.model.User;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * <b>Description:</b> RabbitMQ -对象接收 <br/>
 * @author Lingwenjun
 * @date 2019/1/4-17:45
 * @version 1.0
 */
@Component
@RabbitListener(queues = "user")
public class ObjectReceiver {

    @RabbitHandler
    public void process(User user) {
        System.out.println("Receiver : user = [" + user + "]");
    }
}
